
testMinify(
'function a(var1, var2) {\n\
	var var3, var4;\n\
	for (var3 = var1; var3 < 10; var3++);\n\
}',

'function a(c) {\n\
	for (var b = c; b < 10; b++) {}\n\
}'
);

testMinify(
'function a(var1, var2) {\n\
	var var3, var4;\n\
	for (var3 in var1);\n\
}',

'function a(b) {\n\
	for (var c in b) {}\n\
}'
);

testMinify(
'function a(var1, var2) {\n\
	var var3, var4;\n\
	for (var3 = var2; var3 < 10; var3++);\n\
}',

'function a(d, c) {\n\
	for (var b = c; b < 10; b++) {}\n\
}'
);

testMinify(
'function a() {\n\
	var var3;\n\
	var fun = function() { var3 = 1; }\n\
	return fun;\n\
}',

'function a() {\n\
	var c, b = function() {\n\
		c = 1;\n\
	};\n\
	return b;\n\
}'
);

testMinify(
'function a(var1) {\n\
	var var3;\n\
	var fun = function(var4) {\n\
		var3 = 1;\n\
		eval(var4);\n\
	}\n\
	return fun;\n\
}',

'function a(var1) {\n\
	var var3, fun = function(var4) {\n\
		var3 = 1;\n\
		eval(var4);\n\
	};\n\
	return fun;\n\
}'
);

testMinify(
'function a(var1) {\n\
	var var3;\n\
	var fun = function(var4) {\n\
		var3 = 1;\n\
		eval(var4);\n\
	}\n\
	var3 = 2;\n\
	return fun;\n\
}',

'function a(var1) {\n\
	var fun = function(var4) {\n\
		var3 = 1;\n\
		eval(var4);\n\
	}, var3 = 2;\n\
	return fun;\n\
}'
);

testMinify(
'function a(var1) {\n\
	var var3;\n\
	var fun = function(var4) {\n\
		var3 = 1;\n\
		eval(var4);\n\
	}\n\
	typeof fun;\n\
	var3 = 2;\n\
	return fun;\n\
}',

'function a(var1) {\n\
	var fun = function(var4) {\n\
		var3 = 1;\n\
		eval(var4);\n\
	};\n\
	typeof fun;\n\
	var var3 = 2;\n\
	return fun;\n\
}'
);

testMinify(
'function a() {\n\
	var a, b, e, c, d;\n\
	b = 1;\n\
	c = 3;\n\
	a = 2;\n\
	return [e, d];\n\
}',

'function a() {\n\
	var e, d, b = 1, c = 3, a = 2;\n\
	return [ e, d ];\n\
}'
);

testMinify(
'function a() {\n\
	var b, c;\n\
	typeof a;\n\
	c = 2;\n\
	return b;\n\
}',

'function a() {\n\
	typeof a;\n\
	var c = 2, b;\n\
	return b;\n\
}'
);

testMinify(
'function a() {\n\
	var b, c;\n\
	for (c in a);\n\
	return b;\n\
}',

'function a() {\n\
	var b, c;\n\
	for (c in a) {}\n\
	return b;\n\
}'
);

testMinify(
'function a() {\n\
	var b, longVar;\n\
	for (longVar in a) {\n\
		eval(x);\n\
	}\n\
	return b;\n\
}',

'function a() {\n\
	var b;\n\
	for (var longVar in a)\n\
		eval(x);\n\
	return b;\n\
}'
);

testMinify(
'function a() {\n\
	var b, c;\n\
	for (c = 1; c < 10; c++);\n\
	return b;\n\
}',

'function a() {\n\
	for (var c = 1, b; c < 10; c++) {}\n\
	return b;\n\
}'
);

testMinify(
'function a() {\n\
	var b, c, d, e;\n\
	for (b = 1, c = 2; c < 10; c++);\n\
	for (d = 1, e = 2; c < 10; c++);\n\
	return b;\n\
}',

'function a() {\n\
	for (var b = 1, c = 2; c < 10; c++) {}\n\
	for (var d = 1, e = 2; c < 10; c++) {}\n\
	return b;\n\
}'
);

testMinify(
'function a() {\n\
	var b;\n\
	c = b;\n\
}',

'function a() {\n\
	var b;\n\
	c = b;\n\
}'
);

testMinify(
'function a() {\n\
	var b;\n\
	return function() {\n\
		var c;\n\
		for (b = 1, c = 2; c < 10; c++);\n\
	};\n\
}',

'function a() {\n\
	var b;\n\
	return function() {\n\
		var c;\n\
		for (b = 1, c = 2; c < 10; c++) {}\n\
	};\n\
}'
);

testMinify(
'function a() {\n\
	var b;\n\
	return function() {\n\
		var c, d;\n\
		for (d = 1, c = 2; c < 10; c++);\n\
	}(b);\n\
}',

'function a() {\n\
	var b;\n\
	return function() {\n\
		for (var d = 1, c = 2; c < 10; c++) {}\n\
	}(b);\n\
}'
);

testMinify(
'var a = function(){}',
'var a = function() {};'
);

testMinify(
'var a,b;\n\
a = 1, b = 2;',

'var a = 1, b = 2;'
);

testMinify(
'function asdf(){}',
'function asdf() {}'
);

testMinify(
'(function asdf(){})',
'(function a() {});'
);

testMinify(
'function a(bbb) { var bbb; return bbb; }',
'function a(b) {\n\
	return b;\n\
}'
);

testMinify(
'var qwerty1, qwerty2, qwerty3;\n\
a();\n\
qwerty2 = 1;',

'a();\n\
var qwerty2 = 1, qwerty1, qwerty3;'
);

testMinify(
'var a, b, e;\n\
c(), a = 1, b = 2, d();',

'c();\n\
var a = 1, b = 2, e;\n\
d();'
);

testMinify(
'var a, b, e;\n\
c(), a = 1, b = 2;',

'c();\n\
var a = 1, b = 2, e;'
);

testMinify(
'var a, b, e;\n\
c();\n\
a = 1, b = 2, d();',

'c();\n\
var a = 1, b = 2, e;\n\
d();'
);

testMinify(
'var a, e;\n\
c(), a = 1, d();',

'c();\n\
var a = 1, e;\n\
d();'
);

testMinify(
'var a, e;\n\
c(), a = 1;',

'c();\n\
var a = 1, e;'
);

// "var X;" requires semicolon
testMinify(
'function d(){\n\
	if (a) {\n\
		var b = 1;\n\
		// comment\n\
	} else\n\
		c();\n\
}',

'function d() {\n\
	if (a)\n\
		var b = 1;\n\
	else\n\
		c();\n\
}'
);

testMinify(
'function d(){\n\
	if (a)\n\
		var b = 1;\n\
	else\n\
		c();\n\
}',

'function d() {\n\
	if (a)\n\
		var b = 1;\n\
	else\n\
		c();\n\
}'
);

testMinify(
'function d(){\n\
	if (a)\n\
		var b = 1, e = 2;\n\
	else\n\
		c();\n\
}',

'function d() {\n\
	if (a)\n\
		var b = 1, e = 2;\n\
	else\n\
		c();\n\
}'
);

for (var i = 0; i < Alkaline.JSInfo.collapsibleOperators.length; i++) {
	var op = Alkaline.JSInfo.collapsibleOperators[i];
	testMinify(
	'a = a ' + op + ' b',
	'a ' + op + '= b;'
	);
	testMinify(
	'a.a = a.a ' + op + ' b',
	'a.a ' + op + '= b;'
	);
}
